#include "thread_manager.h"

#define DBG_TAG    "th_init"
#define DBG_LVL    DBG_INFO
#include <rtdbg.h>



/* max msg size of mq */
#define MQ_MSG_SIZE_HOST       (MSG_MAX_HOST * sizeof(struct Msg_InterThread))
#define MQ_MSG_SIZE_COMM       (MSG_MAX_COMM * sizeof(struct Msg_InterThread))

struct rt_messagequeue *mq_host;
struct rt_messagequeue *mq_comm;

static void mq_init(void)
{
    mq_host = rt_mq_create("mq_host", MQ_MSG_SIZE_HOST, 5, RT_IPC_FLAG_FIFO);
    mq_comm = rt_mq_create("mq_comm", MQ_MSG_SIZE_COMM, 5, RT_IPC_FLAG_FIFO);
}
int init(void)
{
    mq_init();
    
    thread_can_init();
    host_thread_init();
    comm_thread_init();
        
    return 0;
}